#include"Brighe.h"
CBrighe::CBrighe(int _kind,int _x, int _y, int _width, int _height)
{
	kind=_kind;
	x=_x;
	y=_y;
	if(kind==27) vy=-0.25f;
	else vy=0.25f;
	width=_width;
	height=_height;
	brighe=new CSprite(true,0,257,width,height,0,0,0);
}
CBrighe::~CBrighe()
{
	if(brighe!=NULL) delete brighe;
}
void CBrighe::Render(LPD3DXSPRITE sprite, LPDIRECT3DTEXTURE9 image, int time, int xcamara)
{
	Move(time);
	brighe->Render(sprite,image,x-xcamara,y);
}
RECT CBrighe::getRECT()
{
	RECT rect;
	/*rect.left=0;
	rect.right=0;
	rect.bottom=0;
	*/
	rect=brighe->getRECT(x,y);
	return rect;
}
void CBrighe::Move(int time)
{
	if(kind==26&&y>480) y=0;
	if(kind==27&&y<0) y=480;
	y+=vy*time;
}